home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-03-04 | 986 b | 34 lines | [TEXT/PJMM] |
- unit Filestuff;
- { From Macintosh Technical Notes #24 }
- { by Bryan Stearns}
-
- interface
- function GetIndVolume (whichVol: integer; var volName: str255; var volRefNum: Integer): OSErr;
-
- implementation
-
- function GetIndVolume; {(whichVol: integer, var volName: str255, var volRefNum: Integer): OSErr;}
-
- {Return the name and vRefNum of volume specified by whichVol}
-
- var
- volPB: HParamBlockRec;
- error: OSErr;
- begin
- with volPB do {makes it easier to fill in!}
- begin
- ioNamePtr := @volName; {make sure it returns the name}
- ioVRefNum := 0; {0 means use ioVolIndex}
- ioVolIndex := whichVol; {use this to determine the volume}
- end; {with}
- error := PBHGetVInfo(@volPB, false); {do it}
- if error = noErr then
- begin
- volRefNum := volPB.ioVRefNum;
- end; {if no error}
- {other information is available from this record; see the FILE }
- {Manager's description of PBHGetVInfo for more details}
- GetIndVolume := error; {return error code}
- end;
-
- end. {of unit}